import { ListInterFace, ListModel, PageListInterface, PageModel } from './common';

class FileModel {
  public active: boolean;
  public client_id: string;
  public create_at: number;
  public current_version: number;
  public current_version_size: number;
  public external_id: string;
  public id: string;
  public locked: boolean;
  public lockedAt: number;
  public lockedBy: string;
  public name: string;
  public owner: string;
  public parent_id: string;
  public path: string;
  public project_id: string;
  public update_at: number;
  public versions: VersionModel[];
}

class FolderModel {
  public active: boolean;
  public client_id: string;
  public create_at: number;
  public external_id: string;
  public id: string;
  public locked: boolean;
  public lockedAt: number;
  public lockedBy: string;
  public name: string;
  public owner: string;
  public parent_id: string;
  public path: string;
  public update_at: number;
  public user_data: string;
}

class VersionModel {
  public active: boolean;
  public comments: string;
  public create_at: number;
  public entry_id: string;
  public id: number;
  public owner: string;
  public size: number;
  public update_at: number;
  public version: number;
}

class FileListModel extends ListModel {
  public file_count: number;
  public files: FileModel[];
  public folder_count: number;
  public folders: FolderModel[];
}

class FilePageModel extends PageModel {
  public data: FileListModel;
}

class FolderInfoModel {
  public accountId: string;
  public projectId: string;
  public folderId: string;
  public parentId: string;
  public name: string;
  public owner: string;
  public clientId: string;
  public path: string;
  public createAt: string;
  public updataAt: string;
  public active: boolean;
}

class FilePathModel {
  public id: string;
  public name: string;
  public brothers: NodeSimpleModel[];
  public child: FilePathModel;
}

class NodeSimpleModel {
  public id: string;
  public name: string;
}

class SubscriptionModel {
  public clientId: string;
  public createAt: number;
  public id: string;
  public projectId: string;
  public subscriber: string;
  public targetName: string;
  public targetPath: string;
  public targetUrn: string;
}

class CollectionModel {
  public clientId: string;
  public createAt: number;
  public id: string;
  public projectId: string;
  public collector: string;
  public targetName: string;
  public targetPath: string;
  public targetUrn: string;
}

class SubscriptionPageModel extends PageModel implements PageListInterface<SubscriptionModel> {
  data: ListInterFace<SubscriptionModel>
}

class CollectionPageModel extends PageModel implements PageListInterface<CollectionModel> {
  data: ListInterFace<CollectionModel>
}

export {
  FileModel,
  FolderModel,
  FilePageModel,
  FolderInfoModel,
  FilePathModel,
  SubscriptionModel,
  CollectionModel,
  SubscriptionPageModel,
  CollectionPageModel
};
